package test.peaksport.framework.metadata.entity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.peaksport.framework.base.entity.BillEntryBaseEntity;
import com.peaksport.framework.base.entity.CoreBaseEntity;
import com.peaksport.framework.base.venum.BaseIntConverter;
import com.peaksport.framework.base.venum.BaseIntEnum;
import com.peaksport.framework.uuid.PKEntityType;
import com.peaksport.framework.venum.BillBaseStatusEnum;

import lombok.Getter;
import lombok.Setter;


@SuppressWarnings("serial")
@Getter
@Setter
@Entity
@Table(name = "T_TST_BillEntry")
public class TBillEntryEntity extends BillEntryBaseEntity {
	
	@Convert(converter = BaseIntConverter.class)
	@Column(name = "FLineStatus")
	private BillBaseStatusEnum lineStatus;

	@JsonBackReference
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "FParentID")
	private TBillEntity parent;
	
	@Override
	public PKEntityType getEntityType() {
		return PKEntityType.create("5CB6944B");
	}

	@Override
	public TBillEntity getParent() {
		return parent;
	}

	@Override
	public void setParent(CoreBaseEntity parent) {
		this.parent = (TBillEntity) parent;
		
	}

}
